package com.happe.foodeasy.manage.dto;

import org.springframework.beans.BeanUtils;

public class BaseDTO<T> {
    private long id;
    private String validFlag;
    public void fromEntity(T entity) {
        BeanUtils.copyProperties(entity, this);
    }

    public T toEntity(T entity) {
        BeanUtils.copyProperties(this, entity);
        return entity;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getValidFlag() {
        return validFlag;
    }

    public void setValidFlag(String validFlag) {
        this.validFlag = validFlag;
    }
}
